﻿@using HynuIOTA.Entity
@{
    ViewBag.Title = "衡阳师范学院物联网协会";
    List<News> news = ViewBag.news;
    List<Notice> notice = ViewBag.notice;
    List<BlogArticle> blogs = ViewBag.blogs;
    List<News> imgNews = ViewBag.imgNews;
    List<Channel> channel = ViewBag.channel;
}
@section script
{
    <script src="~/Scripts/jquery.nav.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('.hot-event').nav({
                t: 5000,	//轮播时间
                a: 1500,  //过渡时间
                n: @imgNews.Count, // 图片数量
            });
        });
    </script>
}
<div id="index1-div1" class="clearfix">
    <div class="index1-left675">
        <div class="hot-event">
            <div class="switch-nav"><a href="#" onclick="return false;" class="prev"><i class="ico i-prev">上一个</i></a><a href="#" onclick="return false;" class="next"><i class="ico i-next">下一个</i></a></div>
            @{
                var length = imgNews.Count;

                for (var i = 0; i < length; i++)
                {
                    var item = imgNews[i];
                    if (i == 0)
                    {
                        <div class="event-item" style="display:block;"><a href="@($"{Url.Content("~/ShowNews/")}{item.Id}.shtml")"><div class="event-box"><img src="@item.Img" class="photo" alt="@item.Title" /></div><span>@item.Title</span></a></div>
                    }
                    else
                    {
                        <div class="event-item"><a href="@($"{Url.Content("~/ShowNews/")}{item.Id}.shtml")"><div class="event-box"><img src="@item.Img" class="photo" alt="@item.Title" /></div><span>@item.Title</span></a></div>
                    }
                }
            }
            <div class="switch-tab">
                @{
                    for (var i = 0; i < length; i++)
                    {
                        if (i == 0)
                        {
                            <a href="javascript:void(0);" onclick="return false;" class="current">1</a>
                        }
                        else
                        {
                            <a href="javascript:void(0);" onclick="return false;">@(i + 1)</a>
                        }
                    }
                }
            </div>
        </div>
    </div>
    <div class="index1-right300">
        <div class="title-box">频道列表</div>
        <ul>
            @{
                foreach (var item in channel)
                {
                    <li><a href="@Url.Content($"~/Channel/{item.Id}/1.shtml")">@item.Name</a><span>新闻数：@item.News.Count</span></li>
                }
            }
        </ul>
    </div>
</div>
<!-- index1-div2 -->
<div id="index1-div2" class="clearfix">
    <div class="index1-left675" style="width: 100%">
        <div class="index1-li-box">
            <div class="index1-left330">
                <div class="title-box">通知公告<a href="@Url.Content("~/Notices/1.shtml")" class="title-more" title="查看更多"><img src="~/Images/12.gif"></a></div>
                <ul>
                    @{
                        foreach (var item in notice)
                        {
                            <li><a href="@($"{Url.Content("~/ShowNotice/")}{item.Id}.shtml")">@item.Title</a><span>@item.CreateTime.ToShortDateString()</span></li>
                        }
                    }
                </ul>
            </div>
            <div class="index1-center330">
                <div class="title-box">协会新闻<a href="@Url.Content("~/News/1.shtml")" class="title-more" title="查看更多"><img src="~/Images/12.gif"></a></div>
                <ul>
                    @{
                        foreach (var item in news)
                        {
                            <li><a href="@($"{Url.Content("~/ShowNews/")}{item.Id}.shtml")">@item.Title</a><span>@item.CreateTime.ToShortDateString()</span></li>
                        }
                    }
                </ul>
            </div>
            <div class="index1-right330">
                <div class="title-box">最新博客文章<a href="@Url.RouteUrl("ArticleList",new{page = 1})" class="title-more" title="查看更多"><img src="~/Images/12.gif"></a></div>
                <ul>
                    @{
                        foreach (var item in blogs)
                        {
                            <li><a href="@Url.RouteUrl("ShowArticle",new{Id = item.Id})">@item.Title</a><span>@item.WriteTime.ToShortDateString()</span></li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
</div>